#pragma once

#include <AST/ExprAST.hpp>
#include <string>
#include <llvm/ADT/SmallVector.h>

class Call : public Expr {
  protected:
    using ArgsVector = llvm::SmallVector<Expr *>;

  private:
    // 函数名
    string funName;

    // 实参列表
    ArgsVector args;

    // TODO: 函数的返回值类型，需要查符号表
    Type *returnType = nullptr;

  public:
    Call(string funName, ArgsVector args);

    virtual Value *codegen() override;

    friend class graphviz::GraphGenerator;

    virtual VisitResult accept(ASTVisitor &visitor) const override {
        return visitor.visitCallAST(this);
    }
};